﻿using System;
using System.IO;

namespace SampleBrowser.Common.IO
{
    /// <summary>
    /// Defines the contract for decrypting package parts.
    /// </summary>
    public interface IPackageDecrypter
    {
        /// <summary>
        /// Maps a request for given part to another part 
        /// </summary>
        /// <param name="partUri">The part URI.</param>
        /// <returns>The mapped URI.</returns>
        /// <remarks>
        /// Part URI mapping allows a package to store encrypted parts in a another location.
        /// </remarks>
        Uri MapPartUri(Uri partUri);
        /// <summary>
        /// Decrypts the specified part.
        /// </summary>
        /// <param name="partUri">The part URI.</param>
        /// <param name="stream">The stream.</param>
        /// <returns></returns>
        Stream DecryptPart(Uri partUri, Stream stream);
    }
}
